package com.njmaomao.gj.pyot.domain.wechat;

import com.njmaomao.gj.pyot.common.bean.BaseRequest;

import java.io.Serializable;

/**退款结果回调到其他业务系统的消息
 * @author dylan
 * @time 2018/5/22.
 */
public class RefundCallbackMessage extends BaseRequest implements Serializable{

    /**
     * 退款单号
     */
    private String refundNo;
    /**
     * 支付企业生成的退款单号
     */
    private String refundId;

    /**
     * 订单来源系统
     */
    private String sourceSystem;

    /**
     * 退款金额
     */
    private Integer refundAmount;
    /**
     * 退款状态(同RefundRecord的status)
     */
    private int status;

    public String getRefundNo() {
        return refundNo;
    }

    public void setRefundNo(String refundNo) {
        this.refundNo = refundNo;
    }

    public String getSourceSystem() {
        return sourceSystem;
    }

    public void setSourceSystem(String sourceSystem) {
        this.sourceSystem = sourceSystem;
    }

    public String getRefundId() {
        return refundId;
    }

    public void setRefundId(String refundId) {
        this.refundId = refundId;
    }

    public Integer getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(Integer refundAmount) {
        this.refundAmount = refundAmount;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public static Builder newBuilder(){
        return new Builder(new RefundCallbackMessage());
    }

    /**
     *
     */
    public static class Builder{
        private RefundCallbackMessage message;

        public Builder(RefundCallbackMessage message) {
            this.message = message;
        }

        public Builder withSeqNo(String seqNo){
            message.setSeqNo(seqNo);
            return this;
        }
        public Builder withFromSystem(String fromSystem){
            message.setFromSystem(fromSystem);
            return this;
        }

        public Builder withSourceSystem(String sourceSystem){
            message.setSourceSystem(sourceSystem);
            return this;
        }

        public Builder withRefundNo(String refundNo){
            message.setRefundNo(refundNo);
            return this;
        }

        public Builder withRefundId(String refundId){
            message.setRefundId(refundId);
            return this;
        }

        public Builder withRefundAmount(int refundAmount){
            message.setRefundAmount(refundAmount);
            return this;
        }

        public Builder withStatus(int status){
            message.setStatus(status);
            return this;
        }

        public RefundCallbackMessage build(){
            return message;
        }
    }
}
